<?php

namespace app\api\validate;

use think\Validate;

class VolunteerAudit extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        //'area_one_id'  =>  'require',
       // 'area_tow_id'  =>  'require',
        'name'  =>  'require|max:10',
        'id_card'  =>  'require|max:20',
        'birthday'  =>  'require',
        //'id_card_positive_images'  =>  'require',
       // 'id_card_back_images'  =>  'require',
        'mobile'  =>  'require',
        //'province'  =>  'require',
       // 'city'  =>  'require',
        // 'district'  =>  'require',
        'address'  =>  'require|max:30',
      //  'email'  =>  'max:30',
      //  'emergency_contact'  =>  'max:10',
       // 'id'  =>  'require|integer|gt:0',
       // 'content'  =>  'require|max:200',
       // 'score'  =>  'require|number|gt:0',
       // 'code'  =>  'require',

    ];
    /**
     * 提示消息
     */
    protected $message = [
       // 'area_one_id.require'  =>  '請選擇區域',
        'area_tow_id.require'  =>  '請選擇二級區域',
        'name.require'  =>  '請輸入姓名',
        'name.max'  =>  '姓名不得超過10個字符',
        'id_card.require'  =>  '請輸入身份證號碼',
        'id_card.max'  =>  '身份證號碼不得超過20個字符',
        'birthday.require'  =>  '請選擇出生日期',
        'id_card_positive_images.require'  =>  '請上傳身份證正面照',
        'id_card_back_images.require'  =>  '請上傳身份證反面照',
        'mobile.require'  =>  '請輸入手機號碼',
        //'mobile.gt'  =>  '手機號碼必須為正整數',
        // 'mobile.max'  =>  '手機號碼不得超過10個字符',
       // 'province.require'  =>  '請選擇省份',
       // 'city.require'  =>  '請選擇城市',
        'address.require'  =>  '請輸入地址',
        'address.max'  =>  '地址不得超過30個字符',
        'email.max'  =>  '電郵不得超過30個字符',
        'emergency_contact.max'  =>  '香港聯絡人不得超過10個字符',
        'id.require'  =>  '請求參數不能為空',
        'id.integer'  =>   '請求參數類型錯誤',
        'id.gt'  =>   '請求參數類型錯誤',
        'content.require'  =>  '請輸任務說明',
        'content.max'  =>  '任務說明不得超過200個字符',
        'score.require'  =>  '請選擇評分',
        'score.number'  =>   '評分為數字',
        'score.gt'  =>   '評分不得小於等於0',
        'code.require'  =>  '請掃碼',
        // 'code.number'  =>   '编码必须是数字',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name','type','code'],
        'apply'  => ['area_one_id','area_tow_id','name','id_card','birthday','mobile','province','city','address','email','emergency_contact'],
        'task'  => ['id'],
        'submittask' => ['id','content'],
        'submitTtask' => ['id','content','score','code'],
        'edit' => [],
    ];
    
}
